Imports Microsoft.ApplicationBlocks.Data.SqlHelper
Imports System.Data.SqlClient
Public Class Recepciones

    Public Function ObtenerUltimaRecepcion() As DataSet
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "RecepcionUltimaObtener")
        Return DS
    End Function

    Public Function ObtenerPendientes()
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "RecepcionesPendientesObtener")
        Return DS
    End Function

    Public Sub Modificar()
        ExecuteNonQuery(My.Settings.MiCadena, CommandType.StoredProcedure, "RecepcionModificar")
    End Sub

    Public Function Insertar(ByVal Silo As Integer, ByVal PesoBruto As Integer, ByVal PesoTara As Integer, ByVal PesoNeto As Integer)
        Dim I As Integer
        I = ExecuteScalar(My.Settings.MiCadena, CommandType.StoredProcedure, "RecepcionInsertar", New SqlParameter("@Silo", Silo), New SqlParameter("@PesoBruto", PesoBruto), New SqlParameter("@PesoTara", PesoTara), New SqlParameter("@PesoNeto", PesoNeto))
        Return I
    End Function

    Public Function ObtenerById(ByVal IdRecepcion As Integer) As DataSet
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "RecepcionesObtenerById")
        Return DS
    End Function

    Public Function ObtenerEstados() As DataSet
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, "EstadosObtener")
        Return DS
    End Function

    Public Function RecepcionesLlenarCombos() As DataSet
        Return ExecuteDataset(My.Settings.MiCadena, "ProductosCaracteristicasObtener")
    End Function
End Class
